<?php

use magein\think\pay\controller\PayController;
use think\facade\Route;

Route::group('pay', function () {
    Route::post('unify', PayController::class . '@unify');
    Route::post('qrcode', PayController::class . '@qrcode');
    Route::get('qrcode/available', PayController::class . '@qrcodeAvailable');
    Route::get('query', PayController::class . '@query');
})->middleware(config('pay.middleware.auth') ?: []);

// 收银台
Route::any('pay/center', PayController::class . '@center')->middleware(config('pay.middleware.center') ?: []);
// 扫码支付
Route::any('pay/scan', PayController::class . '@scan')->middleware(config('pay.middleware.scan') ?: []);
// 异步支付回调
Route::any('pay/notify/:pay_no', PayController::class . '@notify')->middleware(config('pay.middleware.notify') ?: []);
// 支付完成回调
Route::any('pay/success/:pay_no', PayController::class . '@success')->middleware(config('pay.middleware.success') ?: []);
// 微信授权获取openid
Route::any('pay/oauth/:account/:pay_no', PayController::class . '@oauth')->middleware(config('pay.middleware.oauth') ?: []);
// 参数测试
Route::any('pay/test', PayController::class . '@test');